<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>杨青青个人博客</title>
<link href="/static/homeconfig/css/base.css" rel="stylesheet">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<script src="/static/homeconfig/js/jquery.js"></script>
<script src="/static/homeconfig/js/nav.js"></script>
</head>
<body>
<!--header end-->
{include file="index/header"}
<!--header end-->
<main>
  <p class="weizhi">您现在的位置是：<a href="/" target="_blank">网站首页</a>><a href="/" target="_blank">博客日记</a></p>
  <article> 
    
    <!--new_blog 最新文章 begin-->
    <div class="new_blog">
      <ul class="blogs">
        {foreach name="date" id="vals"}
        <li onclick="infopage({$vals.id})">
          <i><img src="{$vals.thumb}" alt="标题图片"></i>
          <div class="article">
            <h2>{$vals.title}</h2>
            <p class="blog_smalltext artic1">{$vals.description}</p>
            <p class="blog_info">
              <span>{$vals.pubdate}</span>
              <span>{$vals.author}</span>
              <span><a href="" target="_blank">{$vals.catename}</a></span>
              <span>{$vals.clicks}</span>
              {if condition="$vals.id eq $vals.artid"}
              <span style="background:url(/static/images/like1.png)  no-repeat;background-size: 18px">{$vals.favs}</span>
              {else/}
              <span style="background:url(/static/images/like.png) no-repeat;background-size: 18px" >{$vals.favs}</span>
              {/if}
            </p>
          </div>
        </li>
        {/foreach}
      </ul>
    </div>
    <!--new_blog 最新文章 end--> 
    
  </article>
  <!--article end-->
  
  <aside>
    <div class="search">
      <form action="{:url('bkrj')}" method="post" name="searchform" id="searchform">
        <input name="select" value="{$sel}" id="keyboard" class="input_text" placeholder="请输入关键字词" style="color: rgb(153, 153, 153);" type="text">
        <input name="Submit" class="input_submit" value="搜索" type="submit">
      </form>
    </div>
    <div class="tuijian">
      <h2 class="aside_title">站长推荐</h2>
      <ul>
        {foreach name="tuij" id="val"}
        <li><a href="{:url('info')}?titleid={$val.id}" target="_blank"><i><img src="{$val.thumb}" alt="标题图片"></i>
          <p>{$val.title}</p>
        </a></li>
        {/foreach}
      </ul>
    </div>
    <div class="love">
      <h2 class="aside_title">猜你喜欢</h2>
      <ul>
        <li><a href="/" target="_blank"><i><img src="/static/homeconfig/images/001.jpg" alt="标题图片"></i>
          <p>每个人的生命里都一定会有这么一个人，他告诉我们什么是爱</p>
          </a></li>
        <li><a href="/" target="_blank"><i><img src="/static/homeconfig/images/002.png" alt="标题图片"></i>
          <p>人生就是越努力越幸运！</p>
          </a></li>
        <li><a href="/" target="_blank"><i><img src="/static/homeconfig/images/003.jpg" alt="标题图片"></i>
          <p>『旅行游记』假如你厌倦了现状,那就去云南吧</p>
          </a></li>
        <li><a href="/" target="_blank"><i><img src="/static/homeconfig/images/004.jpg" alt="标题图片"></i>
          <p>追梦路上邂逅爱情,他们携手改写平凡人生!</p>
          </a></li>
        <li><a href="/" target="_blank"><i><img src="/static/homeconfig/images/005.jpg" alt="标题图片"></i>
          <p>遇见你,是我平凡人生中最美的事情</p>
          </a></li>
        <li><a href="/" target="_blank"><i><img src="/static/homeconfig/images/006.jpg" alt="标题图片"></i>
          <p>人生就是越努力越幸运！</p>
          </a></li>
      </ul>
    </div>
    <div class="tagsclous">
      <h2 class="aside_title">标签云</h2>
      <ul>
        {foreach name="labyun" id="yun"}
        <a href="">
          <p>{$yun.l_name }</p>
        </a>
        {/foreach}
      </ul>
    </div>
  </aside>
  <!--aside end--> 
</main>
<!--footer end-->
{include file="index/footer"}
<!--footer end-->
<script>
  function infopage(id) {
    $id=id;
    window.location.href=("{:url('info')}?titleid="+$id);
  }
  $limit=8;
  //上拉加载
  var timeoutInt;   // 要保证最后要运行一次
  window.onscroll = function () {
    setTimeout(function () {
      if (timeoutInt != undefined) {
        window.clearTimeout(timeoutInt);
      }

      timeoutInt = window.setTimeout(function () {
        //监听事件内容
        if($(document).height() == $(window).height() + $(window).scrollTop()){

          $limit+=3;
          console.log($limit)
          $.ajax({
            url:"{:url('xiala1')}",
            data:{limit:$limit},
            type:'post',
            success:function (res) {
              for ($k=0,length=res.length;$k<length;$k++){
                $b=$('.blogs:last').html();
                if(res[$k].id==res[$k].artid){
                  $('.blogs:last').html($b+"<li onclick='infopage("+res[$k].id+")'><i><img src="+res[$k].thumb+"></i><h2>"+res[$k]['title']+"</h2><p class='blog_smalltext artic1'>"+res[$k]['description']+"</p><p class='blog_info'><span>"+res[$k]['pubdate']+"</span><span>"+res[$k]['author']+"</span><span><a href='res[$k]['catename']' target=\"_blank\">"+res[$k]['catename']+"</a></span><span>"+res[$k]['clicks']+"</span><span id='zan' style='background: url(/static/images/like1.png) no-repeat; background-size: 18px'>"+res[$k]['favs']+"</span></p></li>");
                }else{
                  $('.blogs:last').html($b+"<li onclick='infopage("+res[$k].id+")'><i><img src="+res[$k].thumb+"></i><h2>"+res[$k]['title']+"</h2><p class='blog_smalltext artic1'>"+res[$k]['description']+"</p><p class='blog_info'><span>"+res[$k]['pubdate']+"</span><span>"+res[$k]['author']+"</span><span><a href='res[$k]['catename']' target=\"_blank\">"+res[$k]['catename']+"</a></span><span>"+res[$k]['clicks']+"</span><span id='zan' style='background: url(/static/images/like.png) no-repeat; background-size: 18px'>"+res[$k]['favs']+"</span></p></li>");
                }
              }
            }
          })
        }
      }, 105);
    }, 100);
  }
</script>
</body>
</html>
